//
//  CollectionViewCell.m
//  Civacrm
//
//  Created by 王桂敏 on 2017/2/9.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import "CollectionViewCell.h"

@implementation CollectionViewCell

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
    }
    return self;
}

- (void)initView{
    self.backgroundColor = WhiteColor;
    
    self.imageView = [UIImageView imageViewWithFrame:CGRectMake(w(40) /2, h(17), w(50), w(50)) image:nil];
    
    self.imageView.layer.masksToBounds = YES;
    self.imageView.layer.cornerRadius = self.imageView.width / 2;
    self.imageView.layer.borderColor = ColorWithHexString(@"41c3ff").CGColor;
    self.imageView.layer.borderWidth = 1;
    [self addSubview:self.imageView];
    
    self.titleLabel = [UILabel labelWithTitle:nil frame:CGRectMake(0, getMaxY(self.imageView), w(90), h(112) - getMaxY(self.imageView)) font:font(21) textColor:ColorWithHexString(@"a0c0d2") bgColor:ClearColor];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.titleLabel];
    
}

- (void)configCellWithModel:(UserInfoModel *)model{
    
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:model.picUrl] placeholderImage:Image(@"xiaotouxiang_kong")];
    self.titleLabel.text = model.userName;

}
@end
